#ifndef MOTORWIDGET_H
#define MOTORWIDGET_H

#include <QWidget>
#include<QChart>
#include<QtCharts>
#include<QChartView>
#include<QSplineSeries>
namespace Ui {
class motorWidget;
}

class motorWidget : public QWidget
{
    Q_OBJECT

public:
    explicit motorWidget(QWidget *parent = nullptr);
    ~motorWidget();
    typedef enum Aurora_SEND_FOC_TYPE{
            SEND_NONE = 0,
            SEND_FOC_TaTbTc,
            SEND_FOC_IaIbIc,
            SEND_FOC_IqId,
            SEND_FOC_IalphaIbeta,
            SEND_FOC_Position,
    }Aurora_SEND_FOC_TYPE;

    void Send_I_Iq();
    void Send_Iq_PID();
    void Send_Id_PID();

    void Send_Aim_Speed();
    void Send_Speed_PID();

    void Send_Aim_Position();
    void Send_Position_PID();


    void setWaveTitle(double type);

    void SendCMD(uint8_t func1,uint8_t func2,uint8_t func3,float data1,float data2,float data3);

    void readResponse(QByteArray , QString hex_string);




public slots:
    void updateWave(QVector<double> data1,QVector<double> data2,QVector<double> data3,double type);
    void updateFocParam(uint8_t motor,uint8_t index,double data1,double data2,double data3,double data4);
signals:
    void sendData(char *data,int len);
private:
    Ui::motorWidget *ui;

    int             xaxis_index;
    double          xaxis_range;
    QVector<double> list_data1;
    QVector<double> list_data2;
    QVector<double> list_data3;
    QVector<double> list_key1;
    QVector<double> list_key2;
    QVector<double> list_key3;

};

#endif // MOTORWIDGET_H
